:: Check if we are coming from a reboot
IF EXIST %systemDrive%\reboot.tag GOTO :SP2010

:: IIS Application role install
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;WCF-NonHTTP-Activation

:: Pre-Requisites Install
:: has to be manually installed
PrerequisiteInstallerFiles\MSChart.exe /q /norestart
msiexec /i PrerequisiteInstallerFiles\sqlncli.msi /quiet /norestart
msiexec /i PrerequisiteInstallerFiles\SQLSERVER2008_ASADOMD10.msi /quiet /norestart
msiexec /i PrerequisiteInstallerFiles\Synchronization.msi /quiet /norestart
msiexec /i PrerequisiteInstallerFiles\SpeechPlatformRuntime.msi /quiet /norestart
msiexec /i PrerequisiteInstallerFiles\MSSpeech_SR_en-US_TELE.msi /quiet /norestart
msiexec /i PrerequisiteInstallerFiles\FilterPack\FilterPack.msi /quiet /norestart
wusa /quiet /norestart PrerequisiteInstallerFiles\Windows6.1-KB974405-x64.msu
wusa /quiet /norestart PrerequisiteInstallerFiles\Windows6.1-KB976127-v6-x64.msu
wusa /quiet /norestart PrerequisiteInstallerFiles\Windows6.1-KB976462-v2-x64.msu

GOTO :Reboot

:SP2010
::SP2010 Setup
Start /w %~dp0Setup.exe /Config config.XML
del %systemdrive%\reboot.tag
GOTO :END

:Reboot
::Add the runOnce registry key and reboot
echo rebootcheck > %SystemDrive%\reboot.tag
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v SP2010Installer /d %~dp0%0
shutdown -r -t 10

:END
exit